home *** CD-ROM | disk | FTP | other *** search
/ Interactive Preview: Enemy of the State / Interactive Preview: Enemy of the State.iso / pc / alrtthis.dxr / 00014_AlertThis scripts.ls < prev    next >
Encoding:
Text File  |  1998-11-18  |  1.7 KB  |  75 lines

  1. on alertThisEXT message, btn1, cmd1
  2.   global alertWin
  3.   put EMPTY into field "AlertCmd"
  4.   if not voidp(cmd1) then
  5.     put cmd1 into field "AlertCmd"
  6.   end if
  7.   if not voidp(message) then
  8.     put message into field "AlertMessage"
  9.   end if
  10.   updateStage()
  11.   set theLines to the lineCount of member "AlertMessage"
  12.   set msgV to the height of member "AlertMessage"
  13.   set winV to 7 + msgV + 45
  14.   set x to 352
  15.   set y to winV
  16.   tell the stage
  17.     set the rect of alertWin to getCenteredRect(x, y)
  18.   end tell
  19.   repeat with p = 1 to 10
  20.     puppetSprite(p, 0)
  21.   end repeat
  22.   updateStage()
  23.   go("AlertThis")
  24.   repeat with m = 2 to 4
  25.     set the visible of sprite m to 1
  26.     puppetSprite(m, 1)
  27.     updateStage()
  28.   end repeat
  29.   set the visible of sprite 3 to 0
  30.   updateStage()
  31.   repeat with n = 2 to 3
  32.     set the locV of sprite n to winV - 18
  33.   end repeat
  34.   set the locV of sprite 4 to winV - 26
  35.   updateStage()
  36.   if not voidp(btn1) then
  37.     if the number of chars in btn1 > 8 then
  38.       repeat while the number of chars in btn1 > 6
  39.         delete char -30000 of btn1
  40.       end repeat
  41.       set theLastChar to the number of chars in btn1
  42.       put "..." after char theLastChar of btn1
  43.     end if
  44.   end if
  45.   if voidp(btn1) or (btn1 = EMPTY) then
  46.     set btn1 to "OK"
  47.   end if
  48.   set the text of member "AlertBtn" to btn1
  49.   updateStage()
  50.   tell the stage
  51.     playAlert()
  52.   end tell
  53.   tell the stage
  54.     updateStage()
  55.   end tell
  56.   if the machineType = 256 then
  57.     tell the stage
  58.       set the windowType of alertWin to 1
  59.     end tell
  60.   else
  61.     tell the stage
  62.       set the windowType of alertWin to 1
  63.     end tell
  64.   end if
  65.   tell the stage
  66.     set the modal of alertWin to 1
  67.   end tell
  68.   tell the stage
  69.     open(alertWin)
  70.   end tell
  71.   tell the stage
  72.     return EMPTY
  73.   end tell
  74. end
  75.